﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MidApp
{
    public class ManageIsAdministrator
    {
        /// <summary>
        ///Metoda zjistuje, zda prihlaseny uzivatel je administrator.
        ///</summary>
        public static bool IsAdministrator(int UserID)
        {
            var db = MidApp.LinqUse.DBConn;

            var files = (from admin in db.IsAdmins where admin.UserID == UserID select admin).ToList();

            bool b;

            if (files.Count ==1)
                b = true;
            else
                b = false;

            return b;

        }
    }
}
